﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace test_6_17
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int num = 0;
            num=int .Parse(textBox1.Text);
            int result = num;
            while(num > 1)
            {
                num--;
                result = result * num;
            } 
            textBox2.Text="结果为："+result.ToString();
        }
    }
}
